<template>
	<view class="content">
		<view style="height: calc(100vh - 60px);overflow: auto;">
			<home v-if="index == 1"></home>
			<resumption v-if="index == 2"></resumption>
			<memberHome v-if="index == 3"></memberHome>
			<my v-if="index == 4"></my>
		</view>
		<Footer :idx="index"></Footer>
	</view>
</template>

<script>
	import Footer from '../components/footer.vue'
	import home from './home.vue'
	import resumption from './resumption/resumption.vue'
	import memberHome from './memberHome/memberHome.vue'
	import my from './my/my.vue'
	export default {
		components: {
			Footer,
			home,
			resumption,
			memberHome,
			my
		},
		data() {
			return {
				index: 1
			}
		},
		onLoad(option) {
			
		},
		mounted() {
			uni.$on('btnClick', (index) => {
				let userInfo = uni.getStorageSync('userInfo')
				if(index != 1 && !userInfo){
					uni.navigateTo({
						url: '/pages/login'
					})
					return false
				}
				this.index = index
			})
		},
		methods: {
			
			
		}
	}
</script>

<style scoped>
	.logo {
		height: 20px;
		max-width: 20px;
		margin-right: 6px;
		vertical-align: middle;
		display: inline-block;
	}

	.text {
		display: inline-block;
		vertical-align: middle;
	}
	.top-search{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-right: 10px;
	}
	::v-deep .uni-searchbar__box{
		border: 1px solid #898989;
		height: 40px;
		background-color: transparent !important;
		border-radius: 10px !important;
		justify-content: start;
	}
	
</style>